package pers.amos.eshop.advance.product.mapper;

import org.apache.ibatis.annotations.*;
import pers.amos.eshop.advance.product.model.ProductIntro;


@Mapper
public interface ProductIntroMapper {
	
	@Insert("INSERT INTO product_intro(content,product_id) VALUES(#{content},#{productId})")
	@Options(keyColumn = "id", keyProperty = "id", useGeneratedKeys = true)
	void add(ProductIntro productIntro);
	
	@Update("UPDATE product_intro SET content=#{content},product_id=#{productId} WHERE id=#{id}")  
	 void update(ProductIntro productIntro);
	
	@Delete("DELETE FROM product_intro WHERE id=#{id}")  
	 void delete(Long id);
	
	@Select("SELECT * FROM product_intro WHERE id=#{id}")  
	 ProductIntro findById(Long id);
}
